javax.realtime.DSS
Class PriorityInheritanceResource

java.lang.Object
  extended byjavax.realtime.DSS.Resource
      extended byjavax.realtime.DSS.PriorityInheritanceResource
Direct Known Subclasses:
Bridge

public class PriorityInheritanceResource
extends Resource

A Resource modeling a resource that is managed by priority inheritance.

Author:
gary

Field Summary
 
Fields inherited from class javax.realtime.DSS.Resource
busyTimeThusFar, count, creationTime, holderThread, lastGrant, lastRelease, name, signalPriorityInversion, waiters
 
Constructor Summary
PriorityInheritanceResource(java.lang.String name)
           
PriorityInheritanceResource(java.lang.String name, boolean signalPriorityInversion)
          Constructor
 
Method Summary
 void adjustPriority(RealtimeThread thread)
          Adjust the priority of this RealtimeThread, according to resources currently held.
 void release()
          Release this PriorityInheritanceResource.
 void seize()
          Seize this PriorityInheritanceResource.
 
Methods inherited from class javax.realtime.DSS.Resource
dutyCycle, finalize, getExtent, giveResourceTo, maxWaiterPriority, printAllStatistics, printStatistics, releaseIfHeld, seize, seizeIfNotHeld, setExtent, toString, waiterIterator
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PriorityInheritanceResource

public PriorityInheritanceResource(java.lang.String name,
                                   boolean signalPriorityInversion)
Constructor

Parameters:
name - The name of this PriorityInheritanceResource

PriorityInheritanceResource

public PriorityInheritanceResource(java.lang.String name)
Method Detail

seize

public void seize()
           throws java.lang.InterruptedException,
                  ThreadTerminatedException
Seize this PriorityInheritanceResource. An internal loop is required to deal with the case where the resource was stolen between the time it was awarded by a releasing thread and the invoking thread starts to run.

Specified by:
seize in class Resource
Throws:
java.lang.InterruptedException
ThreadTerminatedException

release

public void release()
             throws ThreadTerminatedException
Release this PriorityInheritanceResource. May involve passing it on to a waiting thread.

Specified by:
release in class Resource
Throws:
ThreadTerminatedException

adjustPriority

public void adjustPriority(RealtimeThread thread)
Description copied from class: Resource
Adjust the priority of this RealtimeThread, according to resources currently held.

Specified by:
adjustPriority in class Resource